package 标准类;

public class Student {
    //成员变量
    private String name;
    private int age;
    public  Student(){};

    public Student(String name){
        this.name=name;
    }
    public Student(int age){
        if(age>120||age<0){
            System.out.println("您输入的信息有误");
        }else{
            this.age=age;
        }
    }

    public Student (String name,int age){
        this.name=name;
        if(age>120||age<0){
            System.out.println("您输入的信息有误");
        }else{
            this.age=age;
        }
    }
    public void show(){
        System.out.println(name+","+age);
    }

    public void setName(String name) {
        this.name = name;
    }

    public void setAge(int age) {
        this.age = age;
    }
}